package com.leo;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.control.MenuItem;
import javafx.scene.control.SplitMenuButton;
import javafx.scene.layout.FlowPane;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.stage.Stage;
import org.kordamp.bootstrapfx.scene.layout.Panel;

/**
 * @ClassName LabelDemo
 * @Description
 * @Author wangss
 * @date 2020.11.27 09:57
 * @Version 1.0
 */
public class LabelDemo extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        Panel panel = new Panel("This is the title");
        panel.getStyleClass().add("panel-primary");

        FlowPane fp = new FlowPane();
        fp.setVgap(20);
        fp.setHgap(20);

        Label label = new Label("hello label primary");
        label.getStyleClass().addAll("lbl", "lbl-primary", "h1");
        label.setPrefWidth(200d);
        label.setPrefHeight(60d);

        Label label2 = new Label("hello label primary");
        label2.getStyleClass().setAll("lbl", "lbl-info");
        label2.setFont(Font.font(30));

        Text text = new Text("hello text");
        text.getStyleClass().setAll("h1");

        SplitMenuButton splitMenuButton = new SplitMenuButton();
        splitMenuButton.setText("split");
        MenuItem menuItem11 = new MenuItem("item11");
        MenuItem menuItem12 = new MenuItem("item12");
        MenuItem menuItem13 = new MenuItem("item13");
        splitMenuButton.getItems().addAll(menuItem11, menuItem12, menuItem13);
        splitMenuButton.getStyleClass().addAll("split-menu-btn", "split-menu-btn-primary", "split-menu-btn-lg");


        fp.getChildren().addAll(label, label2, text, splitMenuButton);

        panel.setBody(fp);

        Scene scene = new Scene(panel);
        scene.getStylesheets().add("org/kordamp/bootstrapfx/bootstrapfx.css");

        primaryStage.setTitle("BootstrapFX");
        primaryStage.setScene(scene);
        primaryStage.setWidth(800d);
        primaryStage.setHeight(650d);
        primaryStage.show();
    }
}
